graph drop _all
set scheme sj
set more off
use "\\file\UsersW$\wrr15\Home\My Documents\My Files\ATANDA AKINWANDE\BCD PAPER\HEALTH ECONOMICS revision\NEW DATA AND PROGRAMS (20171021)\BCD_dataset_09_11_2017", clear

sort cid year

xtset cid year
//ge phpnh = 100*phn
//ge lhl = 100*lhsl
ge LHL = lhl
ge PHPNH = phpnh
ge PROD = prod


xtline LHL if cid > 0 & cid < 8, overlay name(FIGURE1a) legend(off) nodraw
xtline LHL if cid > 7 & cid < 15, overlay name(FIGURE1b) legend(off) nodraw
xtline LHL if cid > 14 & cid < 22, overlay name(FIGURE1c) legend(off) nodraw
xtline LHL if cid > 21 & cid < 29, overlay name(FIGURE1d) legend(off) nodraw

graph combine FIGURE1a FIGURE1b FIGURE1c FIGURE1d, col(2) ycommon xcommon iscale(0.8) name(FIGURE1)
  
gsort lhl
list lhl country year in 1/10
gsort -lhl
list lhl country year in 1/10

sort cid year
by cid: summ LHL

summ LHL


  
xtline PHPNH if cid > 0 & cid < 8, overlay name(FIGURE2a) legend(off) nodraw
xtline PHPNH if cid > 7 & cid < 15, overlay name(FIGURE2b) legend(off) nodraw
xtline PHPNH if cid > 14 & cid < 22, overlay name(FIGURE2c) legend(off) nodraw
xtline PHPNH if cid > 21 & cid < 29, overlay name(FIGURE2d) legend(off) nodraw

graph combine FIGURE2a FIGURE2b FIGURE2c FIGURE2d, col(2) ycommon xcommon iscale(0.8) name(FIGURE2)

gsort phpnh
list phpnh country year in 1/10
gsort -phpnh
list phpnh country year in 1/10

sort cid year
by cid: summ PHPNH

summ PHPNH

xtline PROD if cid > 0 & cid < 8, overlay name(FIGURE3a) legend(off)  nodraw
xtline PROD if cid > 7 & cid < 15, overlay name(FIGURE3b) legend(off)  nodraw
xtline PROD if cid > 14 & cid < 22, overlay name(FIGURE3c) legend(off)  nodraw
xtline PROD if cid > 21 & cid < 29, overlay name(FIGURE3d) legend(off)  nodraw

graph combine FIGURE3a FIGURE3b FIGURE3c FIGURE3d, col(2) ycommon xcommon iscale(0.8) name(FIGURE3)

gsort prod
list prod country year in 1/10
gsort -prod
list prod country year in 1/10

xtline k if cid > 0 & cid < 8, overlay name(FIGURE4a) legend(off)  nodraw
xtline k if cid > 7 & cid < 15, overlay name(FIGURE4b) legend(off)  nodraw
xtline k if cid > 14 & cid < 22, overlay name(FIGURE4c) legend(off)  nodraw
xtline k if cid > 21 & cid < 29, overlay name(FIGURE4d) legend(off)  nodraw

graph combine FIGURE4a FIGURE4b FIGURE4c FIGURE4d, col(2) ycommon xcommon iscale(0.8) name(FIGURE4)

gsort k
list k country year in 1/10
gsort -k
list k country year in 1/10
